package cn.com.greatwall.user.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.com.greatwall.common.model.SysRole;
import cn.com.greatwall.common.service.impl.SuperServiceImpl;
import cn.com.greatwall.user.mapper.SysUserRoleMapper;
import cn.com.greatwall.user.model.SysRoleUser;
import cn.com.greatwall.user.service.ISysRoleUserService;

/**
 * @Author herw
 * @Time 2022-01-29 19:21:22
 * @Version 1.0
 * @Description: TODO(用一句话描述该文件做什么)
 */
@Service
public class SysRoleUserServiceImpl extends SuperServiceImpl<SysUserRoleMapper, SysRoleUser> implements ISysRoleUserService {
    @Resource
    private SysUserRoleMapper sysUserRoleMapper;

    @Override
    public int deleteUserRole(Long userId, Long roleId) {
        return sysUserRoleMapper.deleteUserRole(userId, roleId);
    }

    @Override
    public List<SysRole> findRolesByUserId(Long userId) {
        return sysUserRoleMapper.findRolesByUserId(userId);
    }

    @Override
    public List<SysRole> findRolesByUserIds(List<Long> userIds) {
        return sysUserRoleMapper.findRolesByUserIds(userIds);
    }
}
